prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Channel pins in "environment.yaml" files are not saved to package specs
  Channel pins specified in environment files are not respected.  For example,run ```conda env create``` with this environment file:
  
  ```yaml
  name: channel-not-written-to-user-specs
  
  dependencies:
    - defaults::six
  ```
  
  If we look at conda-meta/six*.json we can see that the channel pin has not been added to specs. Where we should read ```"requested_spec": "defaults::six"```, we only find ```"requested_spec": "six"```.
  
  This is with conda 4.4.0rc2.
  
  </issue>
  <code>
  [start of conda_env/installers/conda.py]
  1 from __future__ import absolute_import
  2 
  3 from os.path import basename
  4 
  5 from conda._vendor.boltons.setutils import IndexedSet
  6 from conda.base.context import context
  7 from conda.core.solve import Solver
  8 from conda.models.channel import Channel, prioritize_channels
  9 
  10 
  11 def install(prefix, specs, args, env, *_, **kwargs):
  12     # TODO: support all various ways this happens
  13     # Including 'nodefaults' in the channels list disables the defaults
  14     new_specs = []
  15     channel_urls = set()
  16     for elem in specs:
  17         if "::" in elem:
  18             channel_urls.add(elem.split("::")[0])
  19             new_specs.append(elem.split("::")[-1])
  20         else:
  21             new_specs.append(elem)
  22     specs = new_specs
  23     channel_urls = list(channel_urls)
  24     # TODO: support all various ways this happens
  25     # Including 'nodefaults' in the channels list disables the defaults
  26     channel_urls = channel_urls + [chan for chan in env.channels if chan != 'nodefaults']
  27     if 'nodefaults' not in env.channels:
  28         channel_urls.extend(context.channels)
  29     _channel_priority_map = prioritize_channels(channel_urls)
  30 
  31     channels = IndexedSet(Channel(url) for url in _channel_priority_map)
  32     subdirs = IndexedSet(basename(url) for url in _channel_priority_map)
  33 
  34     solver = Solver(prefix, channels, subdirs, specs_to_add=specs)
  35     unlink_link_transaction = solver.solve_for_transaction(prune=getattr(args, 'prune', False))
  36 
  37     pfe = unlink_link_transaction._get_pfe()
  38     pfe.execute()
  39     unlink_link_transaction.execute()
  40
  [end of conda_env/installers/conda.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/conda_env/installers/conda.py b/conda_env/installers/conda.py
  --- a/conda_env/installers/conda.py
  +++ b/conda_env/installers/conda.py
  @@ -11,19 +11,8 @@
   def install(prefix, specs, args, env, *_, **kwargs):
       # TODO: support all various ways this happens
       # Including 'nodefaults' in the channels list disables the defaults
  -    new_specs = []
  -    channel_urls = set()
  -    for elem in specs:
  -        if "::" in elem:
  -            channel_urls.add(elem.split("::")[0])
  -            new_specs.append(elem.split("::")[-1])
  -        else:
  -            new_specs.append(elem)
  -    specs = new_specs
  -    channel_urls = list(channel_urls)
  -    # TODO: support all various ways this happens
  -    # Including 'nodefaults' in the channels list disables the defaults
  -    channel_urls = channel_urls + [chan for chan in env.channels if chan != 'nodefaults']
  +    channel_urls = [chan for chan in env.channels if chan != 'nodefaults']
  +
       if 'nodefaults' not in env.channels:
           channel_urls.extend(context.channels)
       _channel_priority_map = prioritize_channels(channel_urls)
  
verification_info: {"golden_diff": "diff --git a/conda_env/installers/conda.py b/conda_env/installers/conda.py\n--- a/conda_env/installers/conda.py\n+++ b/conda_env/installers/conda.py\n@@ -11,19 +11,8 @@\n def install(prefix, specs, args, env, *_, **kwargs):\n     # TODO: support all various ways this happens\n     # Including 'nodefaults' in the channels list disables the defaults\n-    new_specs = []\n-    channel_urls = set()\n-    for elem in specs:\n-        if \"::\" in elem:\n-            channel_urls.add(elem.split(\"::\")[0])\n-            new_specs.append(elem.split(\"::\")[-1])\n-        else:\n-            new_specs.append(elem)\n-    specs = new_specs\n-    channel_urls = list(channel_urls)\n-    # TODO: support all various ways this happens\n-    # Including 'nodefaults' in the channels list disables the defaults\n-    channel_urls = channel_urls + [chan for chan in env.channels if chan != 'nodefaults']\n+    channel_urls = [chan for chan in env.channels if chan != 'nodefaults']\n+\n     if 'nodefaults' not in env.channels:\n         channel_urls.extend(context.channels)\n     _channel_priority_map = prioritize_channels(channel_urls)\n", "issue": "Channel pins in \"environment.yaml\" files are not saved to package specs\nChannel pins specified in environment files are not respected.  For example,run ```conda env create``` with this environment file:\r\n\r\n```yaml\r\nname: channel-not-written-to-user-specs\r\n\r\ndependencies:\r\n  - defaults::six\r\n```\r\n\r\nIf we look at conda-meta/six*.json we can see that the channel pin has not been added to specs. Where we should read ```\"requested_spec\": \"defaults::six\"```, we only find ```\"requested_spec\": \"six\"```.\r\n\r\nThis is with conda 4.4.0rc2.\n", "before_files": [{"content": "from __future__ import absolute_import\n\nfrom os.path import basename\n\nfrom conda._vendor.boltons.setutils import IndexedSet\nfrom conda.base.context import context\nfrom conda.core.solve import Solver\nfrom conda.models.channel import Channel, prioritize_channels\n\n\ndef install(prefix, specs, args, env, *_, **kwargs):\n    # TODO: support all various ways this happens\n    # Including 'nodefaults' in the channels list disables the defaults\n    new_specs = []\n    channel_urls = set()\n    for elem in specs:\n        if \"::\" in elem:\n            channel_urls.add(elem.split(\"::\")[0])\n            new_specs.append(elem.split(\"::\")[-1])\n        else:\n            new_specs.append(elem)\n    specs = new_specs\n    channel_urls = list(channel_urls)\n    # TODO: support all various ways this happens\n    # Including 'nodefaults' in the channels list disables the defaults\n    channel_urls = channel_urls + [chan for chan in env.channels if chan != 'nodefaults']\n    if 'nodefaults' not in env.channels:\n        channel_urls.extend(context.channels)\n    _channel_priority_map = prioritize_channels(channel_urls)\n\n    channels = IndexedSet(Channel(url) for url in _channel_priority_map)\n    subdirs = IndexedSet(basename(url) for url in _channel_priority_map)\n\n    solver = Solver(prefix, channels, subdirs, specs_to_add=specs)\n    unlink_link_transaction = solver.solve_for_transaction(prune=getattr(args, 'prune', False))\n\n    pfe = unlink_link_transaction._get_pfe()\n    pfe.execute()\n    unlink_link_transaction.execute()\n", "path": "conda_env/installers/conda.py"}]}